Editing Mode | Insert Mode in the Vim editor
Follow the below steps to enter the editing mode in Vim
Step 1: Open a File in the Vim editor
To modify the content of the file in the Vim editor user has to enter the editing/insert mode first and enter in the editing/insert mode follow the below steps, Create/Open the file using the below command,
vim filename
The file will open in the Vim editor and looks like the below screenshot,
Step 2: Enter Editing Mode
To enter editing/insert mode use any of the following commands based on your preference,
Command |
Description |
---|---|
i |
Press “i” to enter insert mode before the cursor. |
I |
Press “I” to enter insert mode at the beginning of the current line. |
a |
Press “a” to enter insert mode after the cursor. |
A |
Press “A” to enter insert mode at the end of the current line. |
o |
Press “o” to open a new line below the current line and enter insert mode. |
O |
Press “O” to open a new line above the current line and enter insert mode. |
Step 3: Editing Text
When you are in insert mode INSERT will be written in the Vim editor at the bottom it means now you can edit your text, start modifying the file, and make the required changes,
Step 4: Return to Command Mode
When you are done with the editing press Esc to exit editing/insert mode and enter in command mode to execute commands.
Step 5: Save and Exit
Use :wq command to save the changes in the file and quit the editor or :q! command to exit the editor without saving the changes.
Editing Mode | Insert Mode in Vim Editor
This article will cover how to enter editing mode in Vim editor. First, we look at what Linux and VIM editors are and why we use them, followed by commands to enter editing mode in Vim editor along and examples and screenshots.